<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()	+ path + "/";
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%> 
<link rel="stylesheet" href="<%=path%>/css/glsmcx.css" type="text/css" />
<link rel="stylesheet" href="<%=path%>/css/upload.css" type="text/css" >
<script type="text/javascript" src="<%=path%>/js/controllers/orderbillCtrl.js"></script>
<script type="text/javascript" src="<%=path%>/js/libs/jquery.table2excel.js"></script>
<jsp:include page="changePwd.jsp" flush="true"/>
<script type="text/javascript">
	var ctx="<%=path%>";   
	$("#generate-excel").click(function(){
	    $("#excTable").table2excel({ 
	        // 不被导出的表格行列的CSS class类 如果某列不需要在导出的文件中显示：<td class='.noExl'><td>
	        exclude: ".noExl", 
	        // 导出的Excel文件的名称
	        filename: "供应商账单.xls"

	    });
	});
	$("#generate-detail-excel").click(function(){
	    $("#excDetailTable").table2excel({ 
	        // 不被导出的表格行列的CSS class类 如果某列不需要在导出的文件中显示：<td class='.noExl'><td>
	        exclude: ".noExl", 
	        // 导出的Excel文件的名称
	        filename: "供应商账单明细.xls"

	    });
	});
</script>
<input type="hidden" id="isInterior" value="${_user_supplier.isInterior}" />
<div class="glsmcxWrap">
	<div class="container-fluid">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">结算账单</h3>
			</div>
			<input id="queryType" value="ht" style="display:none;"></input>
			<div class="panel-body clearfix">
				<form method="post" action="#" class="form-horizontal" role="form">
					<!-- 查询开始 -->
					<div class="form-group">
						<div class="col-lg-31 clearfix">							
						<label class="control-label labelPart">账单编号：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control" id="id" placeholder="账单编号">
							</div>
						</div>		
								
						<div class="col-lg-31 clearfix">		
						<!-- 对账状态，1等待确认，2账单无误，3账单有误 -->					
							<label class="control-label labelPart">对账状态：</label>							
							<div class="colPart">
								<select name="confirmedStatus">
									<option value="">请选择</option>
									<option value="1">等待确认</option>
									<option value="2">账单无误</option>
									<option value="3">账单有误</option>
								</select>
							</div> 						
						</div>
						
						 <div class="col-lg-31 clearfix">							
						<label class="control-label labelPart">供应商：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control" name="supplierName" placeholder="请输入供应商名称">
							</div>
						</div>
						
						<div class="col-lg-34 more clearfix"> 	
							<div class="morePart"><span>更多筛选</span>&nbsp;</div>													
							<button type="button" class="searchBtn">查询</button>	
							<button type="button" class="clearBtn">清空</button>					
						</div> 
					</div>
					<!-- 查询结束 --> 
					<div class="form-group distant">
					
						<div class="col-lg-31 clearfix">		
						<!-- 转账状态，1待转账，2已转账，3未转账，4转账失败 -->					
							<label class="control-label labelPart">转账状态：</label>							
							<div class="colPart">
								<select name="transferStatus">
									<option value="">请选择</option>
									<option value="1">待转账</option>
									<option value="2">已转账</option>
									<option value="3">未转账</option>
									<option value="4">转账失败</option>
								</select>
							</div> 						
						</div> 
						
						<div class="col-lg-52 time clearfix">
							<label class="control-label labelPart">创建时间：</label>
							<div class="input-daterange input-group start ">
								<input type="text" class="input input-sm form-control" id="date-start" placeholder="起始时间" readonly="readonly" /> 
								<span class="input-group-addon">至</span> 
								<input type="text" class="input input-sm form-control" id="date-end" placeholder="结束时间" readonly="readonly" />
							</div>
						</div>
					 </div> 
					<!-- 查询结束 --> 
					<ul class="clearfix listwork"> 
						<!-- <li id="transferMany" class="add clearfix"><i></i>已转账</li>  -->
						<li class="print clearfix" id="generate-excel"><i></i>导出</li>
					</ul>
					<div class="table-responsive">
						<table class="table table-bordered check left" id="excTable">
							<thead>
								<tr> 
									<th>序号</th>
									<th>供应商</th>
									<th>银行账号</th> 
									<th>银行名称</th> 
									<th>收款人姓名</th>  
 									<th>结算方式</th>  
 								    <th>账单编号</th>
 								    <th>创建日期</th> 
 								    <c:if test="${_user_supplier.isInterior == '1'}">
										<th style="text-align: center;">总订单金额</th>
									</c:if>
 								    <th>供货价</th> 
 								    <th>售后退款金额</th>
 								    <th>运费</th>
 								    <th>税金</th>
 								    <th>其它费用</th>
 								    <!-- <th>调整金额</th> -->
 								    <th>结算金额</th>
 								    <th>对账状态</th>
 								    <th>转账状态</th> 
 								    <th class="noExl">操作</th> 
 								</tr>
 							</thead>
 		
 							<tbody id="dataBody">
 								 
 							</tbody>
 						</table>
 						
 						<table class="table2excel table table-bordered hide">
 						</table>
 					</div>
 				</form>
 			</div>
 		</div>
 		<div class="clearfix pageBottom">	
 			<div class="record-wrapper page" role="status" aria-live="polite">
 				当前<span class="pageNo"> </span>/<span class="totalPages"> </span>页，每页
 				<label class="inline">
 					<select name="dataTable_length" 
 						class="form-control input-sm setTableLength" aria-controls="dataTable">
 						<option selected="selected" value="10">10</option>
 						<option value="20">20</option> 
 				</select> 
 				</label>&nbsp;条记录,共<span class="record-wrapper totalCount">0</span>条记录
 			</div>
 			<nav>
 			<!-- 这里显示分页 -->
 				<div id="Pagination" class="pagination"></div>
 			</nav>
 		</div>
 			
 	</div>
</div>


<!-- 供应商确认账单Modal -->
<div class="modal fade modal-edityd" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true" >
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">账单详情</h4>
			</div>
			<form class="form-horizontal" novalidate="novalidate" id="auditDetailForm">
				<div class="modal-body"> 
					<div class="form-group">
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">账单编号：</label>
							<div class="col-sm-81 dropdown"> 
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="id">  
							</div>
						</div> 

						<div class="col-lg-31">
							<label class="col-sm-41 control-label">结算方式：</label>
							<!-- 结算周期，1当日结算，2周结、3十日结、4月结 -->
							<div class="col-sm-81"> 
								<select disabled="disabled" name="settlementType" value="" class="form-control">
									<option value="1">当日结算</option>
									<option value="2">周结</option>
									<option value="3">十日结</option>
									<option value="4">月结</option>
								</select> 
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">转账状态：</label>
							<div class="col-sm-81">
								<!-- 转账状态，1待转账，2已转账，3未转账，4转账失败 -->
								<select disabled="disabled" name="transferStatus" value="" class="form-control">
									<option value="1">待转账</option>
									<option value="2">已转账</option>
									<option value="3">未转账</option>
									<option value="4">转账失败 </option>
								</select>  
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">生成时间：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="createTime"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">供货价：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="billAmount"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">售后退款金额：</label>
							<div class="col-sm-81 dropdown">  
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="refundAmount">
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">运费：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="freight"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">税金：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="taxAmount"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">其它费用：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" placeholder="0.00" name="otherAmount">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">调整金额：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="adjustAmount" >
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">结算金额：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="settlementAmount">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">对账状态：</label>
							<div class="col-sm-81">
								<!-- 供应商确认状态，1等待确认，2账单无误，3账单有误 -->
								<select disabled="disabled" name="confirmedStatus" value="" class="form-control">
									<option value="1">等待确认</option>
									<option value="2">账单无误</option>
									<option value="3">账单有误</option> 
								</select> 
							</div>
						</div>
					</div>  
					
					<div class="form-group"> 
						<div class="col-lg-122" id="receiveraddr1" style="text-align: center">
							<table class="table" style="margin: auto">
								<thead >
									<tr> 
									    <th style="text-align: center;">订单号</th> 
									    <th style="text-align: center;">收件人</th> 
										<th style="text-align: center;">收件人电话</th>
										<th style="text-align: center;">发货时间</th> 
										<th style="text-align: center;">物流公司</th> 
										<th style="text-align: center;">物流单号</th> 
										<th style="text-align: center;">下单时间</th>
										<th style="text-align: center;">支付时间</th>
										<th style="text-align: center;">运费</th> 
										<th style="text-align: center;">售后退款金额</th>
										<th style="text-align: center;">税金</th>  
									</tr>
								</thead>
	
								<tbody id="orderBillDetailDataBody">
									 
								</tbody>
							</table>
						</div>
					</div> 
			</div> 
			</form>
			<div class="modal-footer  clearfix">
				<span class="red error1 hide"><i></i>信息提交错误</span> 
				<button type="button" class="btn btn-success" id="btn_audit_pass">账单无误</button>
				<button type="button" class="btn btn-danger" id="btn_audit_notpass">账单有误</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> 
				
			</div>
		</div>
	</div>
</div>
<!-- 供应商确认账单Modal -->

<!-- 账单明细Modal -->
<div class="modal fade modal-billdetail" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true" >
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">账单详情</h4>
			</div>
			<form class="form-horizontal" novalidate="novalidate" id="billDetailForm">
				<div class="modal-body"> 
					<div class="form-group">
						
						<!-- <div class="col-lg-31">
							<label class="col-sm-41 control-label">账单编号：</label>
							<div class="col-sm-81 dropdown"> 
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="id">  
							</div>
						</div> 

						<div class="col-lg-31">
							<label class="col-sm-41 control-label">结算方式：</label>
							结算周期，1当日结算，2周结、3十日结、4月结
							<div class="col-sm-81"> 
								<select disabled="disabled" name="settlementType" value="" class="form-control">
									<option value="1">当日结算</option>
									<option value="2">周结</option>
									<option value="3">十日结</option>
									<option value="4">月结</option>
								</select> 
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">转账状态：</label>
							<div class="col-sm-81">
								转账状态，1待转账，2已转账，3未转账，4转账失败
								<select disabled="disabled" name="transferStatus" value="" class="form-control">
									<option value="1">待转账</option>
									<option value="2">已转账</option>
									<option value="3">未转账</option>
									<option value="4">转账失败 </option>
								</select>  
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">生成时间：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="createTime"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">供货价：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="billAmount"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">售后退款金额：</label>
							<div class="col-sm-81 dropdown">  
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="refundAmount">
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">运费：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="freight"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">税金：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="taxAmount"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">其它费用：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" placeholder="0.00" name="otherAmount">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">调整金额：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="adjustAmount" >
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">结算金额：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="settlementAmount">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">对账状态：</label>
							<div class="col-sm-81">
								供应商确认状态，1等待确认，2账单无误，3账单有误
								<select disabled="disabled" name="confirmedStatus" value="" class="form-control">
									<option value="1">等待确认</option>
									<option value="2">账单无误</option>
									<option value="3">账单有误</option> 
								</select> 
							</div>
						</div>
					</div>   -->
					
					<div class="form-group" style="margin-left: 0; margin-right: 0"> 
						<div class="col-lg-122" id="receiveraddr1" style="text-align: center">
							<table class="table" style="margin: auto" id="excDetailTable">
								<thead >
									<tr> 
									    <%-- <th style="text-align: center;">订单号</th> 
									    <th style="text-align: center;">收件人</th> 
										<th style="text-align: center;">收件人电话</th>
										<th style="text-align: center;">发货时间</th> 
										<th style="text-align: center;">物流公司</th> 
										<th style="text-align: center;">物流单号</th> 
										<th style="text-align: center;">下单时间</th>
										<th style="text-align: center;">支付时间</th>
										<c:if test="${_user_supplier.isInterior == '1'}">
											<th style="text-align: center;">订单金额</th>
										</c:if>
										<th style="text-align: center;">运费</th> 
										<th style="text-align: center;">售后退款金额</th>
										<th style="text-align: center;">税金</th>   --%>
										
										
										<th style="text-align: center;">订单号</th> 
										<c:if test="${_user_supplier.isInterior == '1'}">
									   	 	<th style="text-align: center;">订单来源</th> 
									   	</c:if>
									    <th style="text-align: center;">订单状态</th>
										<th style="text-align: center;">供应商id</th>
										<th style="text-align: center;">支付时间</th> 
										<th style="text-align: center;">发货时间</th> 
										<th style="text-align: center;">确认收货时间</th> 
										<th style="text-align: center;">物流公司</th>
										<th style="text-align: center;">物流单号</th>
										<th style="text-align: center;">商品代码</th>
										<th style="text-align: center;">商品名称</th>
										<th style="text-align: center;">商品数量</th>
										<c:if test="${_user_supplier.isInterior == '1'}">
											<th style="text-align: center;">订单金额</th>
										</c:if>
										<th style="text-align: center;">商品成本单价（不含税）</th>
										<th style="text-align: center;">商品成本总价（不含税）</th>  
										<th style="text-align: center;">运费</th> 
										<th style="text-align: center;">税额</th>
										<th style="text-align: center;">结算总金额</th>
										<th style="text-align: center;">对账单号</th>
										
										
									</tr>
								</thead>
	
								<tbody id="billDetailDataBody">
									 
								</tbody>
							</table>
						</div>
					</div> 
			</div> 
			</form>
			<div class="modal-footer  clearfix"> 
				<button type="button" class="btn btn-success" id="generate-detail-excel">导出</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> 
				
			</div>
		</div>
	</div>
</div>
<!-- 账单明细Modal -->

